package com.liam.es.util.similarity;

public class Test {

    public static void main(String[] args) {

        String content1 = "今天天气真好";
        String content2 = "今天天气不错";

        System.out.println(CosineSimilarity.getSimilarity(Tokenizer.jiebaSegment(content1),Tokenizer.jiebaSegment(content2)));
        System.out.println(JaccardSimilarity.getSimilarity(Tokenizer.jiebaSegmentStr(content1),Tokenizer.jiebaSegmentStr(content2)));
        System.out.println(CosineSimilarity.getSimilarity(Tokenizer.segment(content1),Tokenizer.segment(content2)));
        System.out.println(JaccardSimilarity.getSimilarity(Tokenizer.segmentStr(content1),Tokenizer.segmentStr(content2)));

        content1 = "今天小小和爸爸一起去摘草莓，小小说今天的草莓特别的酸，而且特别的小，关键价格还贵";
        content2 = "今天小小和妈妈一起去草原里采草莓，今天的草莓味道特别好，而且价格还挺实惠的";

        System.out.println(CosineSimilarity.getSimilarity(Tokenizer.jiebaSegment(content1),Tokenizer.jiebaSegment(content2)));
        System.out.println(JaccardSimilarity.getSimilarity(Tokenizer.jiebaSegmentStr(content1),Tokenizer.jiebaSegmentStr(content2)));
        System.out.println(CosineSimilarity.getSimilarity(Tokenizer.segment(content1),Tokenizer.segment(content2)));
        System.out.println(JaccardSimilarity.getSimilarity(Tokenizer.segmentStr(content1),Tokenizer.segmentStr(content2)));

        content1 = "电视剧《赘婿》中宁毅的真实身份叫什么？";
        content2 = "电视剧《赘婿》中宁毅最先教了谁腌制皮蛋？";

        System.out.println(CosineSimilarity.getSimilarity(Tokenizer.jiebaSegment(content1),Tokenizer.jiebaSegment(content2)));
        System.out.println(JaccardSimilarity.getSimilarity(Tokenizer.jiebaSegmentStr(content1),Tokenizer.jiebaSegmentStr(content2)));
        System.out.println(CosineSimilarity.getSimilarity(Tokenizer.segment(content1),Tokenizer.segment(content2)));
        System.out.println(JaccardSimilarity.getSimilarity(Tokenizer.segmentStr(content1),Tokenizer.segmentStr(content2)));
    }
}
